package com.stu.boke.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.stu.boke.entity.Link;
import com.stu.boke.mapper.LinkMapper;
import com.stu.boke.service.LinkService;

@Service
public class LinkServiceImpl implements LinkService {
	
	@Autowired
	private LinkMapper linkMapper;

	@Override
	public Integer countLink(Integer status) {
		return linkMapper.countLink(status);
	}

	@Override
	public Link getLinkById(Integer id) {
		return linkMapper.getLinkById(id);
	}

	@Override
	public void updateLink(Link link) {
		link.setLinkUpdateTime(new Date());
		linkMapper.update(link);
	}

	@Override
	public void deleteLink(Integer id) {
		linkMapper.deleteById(id);
	}

	@Override
	public void insertSubmitLink(Link link) {
		link.setLinkCreateTime(new Date());
		link.setLinkUpdateTime(new Date());
		linkMapper.insert(link);
	}

	@Override
	public List<Link> listLink(Integer status) {
		return linkMapper.listLink(status);
	}

	

}
